<table>
	<tr>
		<td>
			<div id="datePicker"></div>
		</td>
	</tr>
	<tr>
		<td>
			<div id="tableData"></div>
		</td>
	</tr>
</table>

<script>
	function selectDate(datum)
	{
		var urlString = "<?=$baseUrl?>" + "Reservation/getTableData/" + datum;
		$.ajax(
		{
			url: urlString,
			context: document.body,
			success: function(data)
			{
				$("#tableData").html(data);
			},
			error: function()
			{
				alert("Error");
			},
			beforeSend: function()
			{
				$("#ajaxLoaderImg").show();
			},
			complete:function()
			{
				$("#ajaxLoaderImg").hide();
			}
		});
	}
	
	$(function() 
	{
		$("#datePicker").datepicker(
		{
			dateFormat: 'yy-mm-dd',
			minDate: new Date("<?=$minDate?>"),
			maxDate: new Date("<?=$maxDate?>"),
			onSelect: function(date) 
			{
				selectDate(date);
			}
		});
	
		selectDate("<?=$minDate?>");
  });
</script>
